package com.user.entity;

import java.util.Objects;

public class UserBooks {
    int bookid;//书的id
    String bookname;//书名
    String author;//作者
    String category;//类别

    public UserBooks(int bookid, String bookname, String author, String category) {
        this.bookid = bookid;
        this.bookname = bookname;
        this.author = author;
        this.category = category;
    }

    public int getBookid() {
        return bookid;
    }

    public void setBookid(int bookid) {
        this.bookid = bookid;
    }

    public String getBookname() {
        return bookname;
    }

    public void setBookname(String bookname) {
        this.bookname = bookname;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UserBooks userBooks = (UserBooks) o;
        return bookid == userBooks.bookid && Objects.equals(bookname, userBooks.bookname) && Objects.equals(author, userBooks.author) && Objects.equals(category, userBooks.category);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bookid, bookname, author, category);
    }

    @Override
    public String toString() {
        return "UserBooks{" +
                "bookid=" + bookid +
                ", bookname='" + bookname + '\'' +
                ", author='" + author + '\'' +
                ", category='" + category + '\'' +
                '}';
    }

}
